package com.wanmait.movie.controller;

import com.wanmait.movie.service.UserService;
import com.wanmait.movie.util.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("manage/user")
public class ManageUserController {
    @Resource
    private UserService userService;
    @GetMapping("list")
    public AjaxResult list(String keyword,Integer pageNum){
        if (pageNum == null || pageNum == 0){
            pageNum = 1;
        }
        return AjaxResult.success("查询成功",userService.getUserList(keyword,pageNum,5)).put("total",userService.getUserList(keyword,pageNum,5).getTotal());
    }
}
